package com.fcx.workai.home_module.util;

import java.math.BigDecimal;
import java.text.DecimalFormat;

import static com.hxh.component.basicore.util.Utils.Text.isEmpty;

/**
 * Created by fucx on 2019/7/17.
 */

public class MoneyTypeUtils {
    /**
     * 货币精确位数
     *   https://my.oschina.net/buwei/blog/222044
     *   out: 12,345,6789.00
     */
    public static String bigDecimalMoney(String money){
        if(!isEmpty(money)){
            BigDecimal bd=new BigDecimal(Integer.parseInt(money));
            DecimalFormat df=new DecimalFormat(",###,####.00");
//            System.out.println("钱=="+df.format(bd));
            return df.format(bd);
        }
        return "";
    }
}
